package com.caption.core.annotations;

import org.springframework.core.annotation.AliasFor;

import java.lang.annotation.*;
import java.util.concurrent.TimeUnit;

/**
 * 防重提交注解
 *
 * @author sunsa
 * @date 2022/1/17 10:22
 */
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface RepeatCommit {

    @AliasFor("name")
    String value() default "REPEAT_COMMIT:";

    @AliasFor("value")
    String name() default "REPEAT_COMMIT:";

    /**
     * 锁超时时间
     *
     * @return
     */
    int timeout() default 30;

    TimeUnit timeUnit() default TimeUnit.SECONDS;
}
